home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / dvibook / libtex / magfactor.c < prev    next >
Text File  |  1994-03-18  |  878b  |  41 lines

  1. /*
  2.  * Copyright (c) 1987, 1989 University of Maryland
  3.  * Department of Computer Science.  All rights reserved.
  4.  * Permission to copy for any purpose is hereby granted
  5.  * so long as this copyright notice remains intact.
  6.  */
  7.  
  8. /*
  9.  * Convert a magnification factor to floating point.  This is used in
  10.  * conjunction with the FONT_SLOP stuff to try to get the file names
  11.  * right, and may also be used by DVI reading programs to get slightly
  12.  * more accurate values for (mag/1000.0).
  13.  */
  14. double
  15. DMagFactor(mag)
  16.     int mag;
  17. {
  18.  
  19.     switch (mag) {
  20.  
  21.     case 1095:        /* stephalf */
  22.         return (1.095445);
  23.  
  24.     case 1315:        /* stepihalf */
  25.         return (1.314534);
  26.  
  27.     case 2074:        /* stepiv */
  28.         return (2.0736);
  29.  
  30.     case 2488:        /* stepv */
  31.         return (2.48832);
  32.  
  33.     case 2986:        /* stepiv */
  34.         return (2.985984);
  35.  
  36.     default:        /* remaining mags have been ok */
  37.         return ((double) mag / 1000.);
  38.     }
  39.     /* NOTREACHED */
  40. }
  41.